const {
	defineConfig
} = require('@vue/cli-service')
module.exports = defineConfig({
	transpileDependencies: true,
	devServer: {
		proxy: {
			// "/api": {
			// 	target: "http://dida100.com:8888",
			// 	changeOrigin: true,
			// 	onProxyReq(req) { //添加请求头
			// 		req.setHeader("http://dida100.com:8888")
			// 	}
			// },
			// https://ys.endata.cn/enlib-api/api/home/getrank_mainland.do
			"/enlib-api/api": {
				target: "https://ys.endata.cn",
				changeOrigin: true,
				onProxyReq(req) { //添加请求头
					req.setHeader("Referer", "https://ys.endata.cn")
				}
			},
			"/enlib-api": {
				target: "https://ys.endata.cn",
				changeOrigin: true,
				onProxyReq(req) { //添加请求头
					// req.setHeader("https://ys.endata.cn")
					req.setHeader("Referer", "https://ys.endata.cn/DataMarket/BoxOffice")
				}
			},
<<<<<<< HEAD
			"/yp": {
				target: "http://dida100.com:8888",
				changeOrigin: true,
				onProxyReq(req) { //添加请求头
					req.setHeader(
						"Referer", "http://dida100.com:8888"
					)
				},
				pathRewrite: {
					"/yp": "/api/yp"
				}
			},
			"/api": {
				target: "http://dida100.com:8888",
				changeOrigin: true,
				onProxyReq(req) { //添加请求头
					req.setHeader(
						"Referer", "http://dida100.com:8888"
					)
				}
			},
			"/upimg": {
				// http://localhost:8080/api/yp/upimg?current=1&size=10&album=1
				target: "http://dida100.com:8888",
				changeOrigin: true,
				onProxyReq(req) { //添加请求头
					req.setHeader(
						"Referer", "http://dida100.com:8888"
					)
				},
				pathRewrite: {
					"/upimg": "/api/yp/upimg"
				}
			}
			
=======
>>>>>>> 5f99a8eef3773d5260916eb8e87b7620b08b2e36
		}
	}
})
